/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.jili.ubert.dao.trace;

import java.io.Serializable;
import com.baidu.bjf.remoting.protobuf.Codec;
import com.baidu.bjf.remoting.protobuf.ProtobufProxy;
import com.baidu.bjf.remoting.protobuf.annotation.Protobuf;
import com.jili.ubert.code.CodeTool;
import java.io.IOException;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author dragon
 */
@Entity
@Table(name = "trace_bail_tempobj")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "TraceBailTempObj.findAll", query = "SELECT t FROM TraceBailTempObj t"),
    @NamedQuery(name = "TraceBailTempObj.findBySid", query = "SELECT t FROM TraceBailTempObj t WHERE t.sid = :sid"),
    @NamedQuery(name = "TraceBailTempObj.findByTraceType", query = "SELECT t FROM TraceBailTempObj t WHERE t.traceType = :traceType"),
    @NamedQuery(name = "TraceBailTempObj.findById", query = "SELECT t FROM TraceBailTempObj t WHERE t.id = :id"),
    @NamedQuery(name = "TraceBailTempObj.findByTempID", query = "SELECT t FROM TraceBailTempObj t WHERE t.tempID = :tempID"),
    @NamedQuery(name = "TraceBailTempObj.findByMarketCode", query = "SELECT t FROM TraceBailTempObj t WHERE t.marketCode = :marketCode"),
    @NamedQuery(name = "TraceBailTempObj.findByClassCode", query = "SELECT t FROM TraceBailTempObj t WHERE t.classCode = :classCode"),
    @NamedQuery(name = "TraceBailTempObj.findByBs", query = "SELECT t FROM TraceBailTempObj t WHERE t.bs = :bs"),
    @NamedQuery(name = "TraceBailTempObj.findByUnderlyingCode", query = "SELECT t FROM TraceBailTempObj t WHERE t.underlyingCode = :underlyingCode"),
    @NamedQuery(name = "TraceBailTempObj.findByObj", query = "SELECT t FROM TraceBailTempObj t WHERE t.obj = :obj"),
    @NamedQuery(name = "TraceBailTempObj.findByBail0", query = "SELECT t FROM TraceBailTempObj t WHERE t.bail0 = :bail0"),
    @NamedQuery(name = "TraceBailTempObj.findByBail1", query = "SELECT t FROM TraceBailTempObj t WHERE t.bail1 = :bail1"),
    @NamedQuery(name = "TraceBailTempObj.findByBail2", query = "SELECT t FROM TraceBailTempObj t WHERE t.bail2 = :bail2"),
    @NamedQuery(name = "TraceBailTempObj.findByBail0Rate", query = "SELECT t FROM TraceBailTempObj t WHERE t.bail0Rate = :bail0Rate"),
    @NamedQuery(name = "TraceBailTempObj.findByBail1Rate", query = "SELECT t FROM TraceBailTempObj t WHERE t.bail1Rate = :bail1Rate"),
    @NamedQuery(name = "TraceBailTempObj.findByBail2Rate", query = "SELECT t FROM TraceBailTempObj t WHERE t.bail2Rate = :bail2Rate"),
    @NamedQuery(name = "TraceBailTempObj.findByOwnUserID", query = "SELECT t FROM TraceBailTempObj t WHERE t.ownUserID = :ownUserID"),
    @NamedQuery(name = "TraceBailTempObj.findByAlterUserID", query = "SELECT t FROM TraceBailTempObj t WHERE t.alterUserID = :alterUserID"),
    @NamedQuery(name = "TraceBailTempObj.findByCreateTime", query = "SELECT t FROM TraceBailTempObj t WHERE t.createTime = :createTime"),
    @NamedQuery(name = "TraceBailTempObj.findByTimeStamp", query = "SELECT t FROM TraceBailTempObj t WHERE t.timeStamp = :timeStamp")})
public class TraceBailTempObj implements Serializable {
	public static byte[] EnCode(TraceBailTempObj msg) throws IOException {
		Codec<TraceBailTempObj> Lcode = ProtobufProxy.create(TraceBailTempObj.class);
		return Lcode.encode(msg);
	}
	public static TraceBailTempObj DeCode(byte[] data) throws IOException {
	Codec<TraceBailTempObj> Lcode = ProtobufProxy.create(TraceBailTempObj.class);
		return Lcode.decode(data);
	}

    private static final long serialVersionUID = 1L;
    @Id
    //@GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "sid")
    @Protobuf
	private Integer sid;
    @Basic(optional = false)
    @Column(name = "TraceType")
    @Protobuf
	private String traceType;
    @Basic(optional = false)
    @Column(name = "id")
    @Protobuf
	private int id;
    @Basic(optional = false)
    @Column(name = "TempID")
    @Protobuf
	private int tempID;
    @Column(name = "MarketCode")
    @Protobuf
	private String marketCode;
    @Column(name = "ClassCode")
    @Protobuf
	private String classCode;
    @Column(name = "BS")
    @Protobuf
	private String bs;
    @Column(name = "UnderlyingCode")
    @Protobuf
	private String underlyingCode;
    @Column(name = "Obj")
    @Protobuf
	private String obj;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Column(name = "Bail0")
    @Protobuf
	private Float bail0;
    @Column(name = "Bail1")
    @Protobuf
	private Float bail1;
    @Column(name = "Bail2")
    @Protobuf
	private Float bail2;
    @Column(name = "Bail0Rate")
    @Protobuf
	private Float bail0Rate;
    @Column(name = "Bail1Rate")
    @Protobuf
	private Float bail1Rate;
    @Column(name = "Bail2Rate")
    @Protobuf
	private Float bail2Rate;
    @Column(name = "OwnUserID")
    @Protobuf
	private String ownUserID;
    @Column(name = "AlterUserID")
    @Protobuf
	private String alterUserID;
    @Column(name = "CreateTime")
    @Temporal(TemporalType.TIMESTAMP)
    private Date createTime;
	//@Protobuf
//tprivate long createTimeL;
    @Column(name = "TimeStamp")
    @Temporal(TemporalType.TIMESTAMP)
    private Date timeStamp;
	//@Protobuf
	//private long timeStampL;

    public TraceBailTempObj() {
    }

    public TraceBailTempObj(Integer sid) {
        this.sid = sid;
    }

    public TraceBailTempObj(Integer sid, String traceType, int id, int tempID) {
        this.sid = sid;
        this.traceType = traceType;
        this.id = id;
        this.tempID = tempID;
    }

    public Integer getSid() {
        return sid;
    }

    public void setSid(Integer sid) {
        this.sid = sid;
    }

    public String getTraceType() {
        return traceType;
    }

    public void setTraceType(String traceType) {
        this.traceType = traceType;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public int getTempID() {
        return tempID;
    }

    public void setTempID(int tempID) {
        this.tempID = tempID;
    }

    public String getMarketCode() {
        return marketCode;
    }

    public void setMarketCode(String marketCode) {
        this.marketCode = marketCode;
    }

    public String getClassCode() {
        return classCode;
    }

    public void setClassCode(String classCode) {
        this.classCode = classCode;
    }

    public String getBs() {
        return bs;
    }

    public void setBs(String bs) {
        this.bs = bs;
    }

    public String getUnderlyingCode() {
        return underlyingCode;
    }

    public void setUnderlyingCode(String underlyingCode) {
        this.underlyingCode = underlyingCode;
    }

    public String getObj() {
        return obj;
    }

    public void setObj(String obj) {
        this.obj = obj;
    }

    public Float getBail0() {
        return bail0;
    }

    public void setBail0(Float bail0) {
        this.bail0 = bail0;
    }

    public Float getBail1() {
        return bail1;
    }

    public void setBail1(Float bail1) {
        this.bail1 = bail1;
    }

    public Float getBail2() {
        return bail2;
    }

    public void setBail2(Float bail2) {
        this.bail2 = bail2;
    }

    public Float getBail0Rate() {
        return bail0Rate;
    }

    public void setBail0Rate(Float bail0Rate) {
        this.bail0Rate = bail0Rate;
    }

    public Float getBail1Rate() {
        return bail1Rate;
    }

    public void setBail1Rate(Float bail1Rate) {
        this.bail1Rate = bail1Rate;
    }

    public Float getBail2Rate() {
        return bail2Rate;
    }

    public void setBail2Rate(Float bail2Rate) {
        this.bail2Rate = bail2Rate;
    }

    public String getOwnUserID() {
        return ownUserID;
    }

    public void setOwnUserID(String ownUserID) {
        this.ownUserID = ownUserID;
    }

    public String getAlterUserID() {
        return alterUserID;
    }

    public void setAlterUserID(String alterUserID) {
        this.alterUserID = alterUserID;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
		//this.createTimeL = CodeTool.DateToLong(createTime);
    }

    public Date getTimeStamp() {
        return timeStamp;
    }

    public void setTimeStamp(Date timeStamp) {
        this.timeStamp = timeStamp;
		//this.timeStampL = CodeTool.DateToLong(timeStamp);
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (sid != null ? sid.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof TraceBailTempObj)) {
            return false;
        }
        TraceBailTempObj other = (TraceBailTempObj) object;
        if ((this.sid == null && other.sid != null) || (this.sid != null && !this.sid.equals(other.sid))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.jili.ubert.dao.trace.TraceBailTempObj[ sid=" + sid + " ]";
    }
    
}
